<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<title>Hello jQuery</title>
<script
	src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$.ajax({
			url : "http://localhost:8080/reEx/rest/json/product/get"
		}).then(function(data) {
			$('.greeting-id').append(' ' + data.name);
			$('.greeting-content').append(' ' + data.qty);
		});
	});

	function getPrice() {

		$.ajax({
			url : "http://localhost:8080/reEx/rest/json/product/get"
		}).then(function(data) {
			$('.greeting-id').replaceWith(' ' + data.name);
			$('.greeting-content').append(' ' + data.qty);
		});

	}
</script>


</head>

<body>
	<div>
		<p class="greeting-id">  The Name is -    </p>
		<p class="greeting-content">The Quantyity is -</p>
		
		<button onclick="getPrice()">get Price</button>
	</div>
</body>
</html>